package com.fau.cm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 企业分机号表
 * @author kangyj
 * @datetime 2015年1月27日,下午4:15:51
 */
@Entity
@Table(name = "medical_enterprise_extension")
public class MedicalEnterpriseExtension implements Serializable, JSONAware {

	private static final long serialVersionUID = 1827021079028379148L;
	
	private String id;
	private String extension;		// 分机号
	private String queue;			// 队列号
	private String jobNum;			// 工号
	private String eid;				// 企业id
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "extension", length = 7)
	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}
	
	@Column(name = "queue", length = 100)
	public String getQueue() {
		return queue;
	}

	public void setQueue(String queue) {
		this.queue = queue;
	}

	@Column(name = "job_num", length = 7)
	public String getJobNum() {
		return jobNum;
	}

	public void setJobNum(String jobNum) {
		this.jobNum = jobNum;
	}

	@Column(name = "eid", length = 32)
	public String getEid() {
		return eid;
	}

	public void setEid(String eid) {
		this.eid = eid;
	}


	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("id", id);
		obj.put("extension", extension);
		obj.put("eid", eid);
		obj.put("queue", queue);
		obj.put("jobNum", jobNum);
		return obj.toJSONString();
	}

}
